module.exports = {
    getCoverViewHeight:function (viewWidth, width, height) {
        return Math.floor(viewWidth / width * height);
    },
    getItemCreateTime:function (objectId) {
        var str = objectId.toString().slice(0, 8);
        var time = parseInt(str, 16) * 1000;
        var date = new Date(time);
        return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
    },
    getMediaTypeText:function (type) {
        var obj = {
            'video':'视频',
            'image':'图片',
            'music':'音乐'
        };
        return obj[type];
    },
    mix : function (obj, obj2) {
        var keys = Object.keys(obj2);
        keys.forEach(function (key) {
            obj[key] = obj2[key];
        });
        return obj;
    }
};